package com.edwarder.action;

import com.edwarder.service.AreaService;
import com.edwarder.service.impl.AreaServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Auther: jzhang
 * @Date: 2018/9/21 15:23
 * @Description:
 */
@WebServlet("/area/list")
public class AreaAction extends HttpServlet {
    private AreaService areaService = new AreaServiceImpl();

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置编码
        response.setContentType("text/html;charset=utf-8");
        String cityid = request.getParameter("cityid");
        String cityString = areaService.getAeaJSONString(cityid);
        response.getWriter().println(cityString);





        
    }
}
